#!/bin/bash

# Replace these three settings.
PROJDIR="/var/www/rtve"
PIDFILE="$PROJDIR/rtve.pid"

cd $PROJDIR
if [ -f $PIDFILE ]; then
    kill `cat -- $PIDFILE`
    rm -f -- $PIDFILE
fi

exec /usr/bin/env - \
  PYTHONPATH="../python:.." \
  ./manage.py runfcgi pidfile=$PIDFILE host=127.0.0.1 port=8080 --settings=settings
